These functions give you high-level pre-packaged access to the video effects architecture. These functions are designed to be easy to use and give you access to the most common uses of the QuickTime Video Effects architecture.
The QTGetEffectsList function returns a QTAtomContainer holding a list of the currently installed effects components. You can constrain the list to certain types of effects, such as those that take two sources. Use this function to obtain a list of effects that you can pass to "QTCreateStandardParameterDialog" .
OSErr QTGetEffectsList (
QTAtomContainer *returnedList,
long minSources,
long maxSources,
QTEffectListOptions getOptions);
This function returns the list of currently installed effects in the returnedList parameter. The returned list contains two atoms for each effect component. The first atom, of type kEffectNameAtom contains the name of the effect. The second atom, of type kEffectTypeAtom contains the type of the effect, which is the sub-type of the effect component. This list is sorted alphabetically on the names of the effects.
The minSources and maxSources parameters allow you to restrict which effects are returned in the list, by specifying the minimum and maximum number of sources that qualifying effects can have. You can also specify whether the "none" effect is included in the list using the getOptions parameter.
The calling application is responsible for disposing of the QTAtomContainer returned in returnedList . The application should do this by calling QTDisposeAtomContainer once it has finished using the parameters description.
This function can take a fairly long time to execute, as it searches the system for installed effects components. You will normally want to call this function once when your application starts, or after a pair of suspend and resume events.
The QTCreateStandardParameterDialog function creates a dialog box that allows the user to choose an effect from the list of effects passed to the function. The user can also set the values of the parameters of the effect chosen. The standard dialog includes a preview of the effect.
OSErr QTCreateStandardParameterDialog (
QTAtomContainer effectList,
QTAtomContainer parameters,
QTParameterDialogOptions dialogOptions,
QTParameterDialog *createdDialog);
This function creates and displays a standard parameter dialog box that allows the user to choose an effect from the list in the effectsList parameter. The dialog box also allows the user to choose values for the parameters of the effect, to preview the effects as they choose and customize them, and to get more information about each effect.
Your application must call the WaitNextEvent and QTIsStandardParameterDialogEvent functions to allow the user to interact with the dialog box that is shown.
Note
The dialog box will remain hidden until the first event is processed by
QTIsStandardParameterDialogEvent
. At this point, the dialog box will be displayed.
The list of effects passed in the effectList parameter should be in the format defined in "QTGetEffectsList" . You should use the QTGetEffectsList function to generate this list.
The parameters parameter returns an effect description data structure, as described in "Creating an Effect Description" . If you pass an empty QTAtomContainer as this parameter, the dialog box will be showing the first effect in effectsList when it appears, otherwise it will display the effect named in the effect description.
The value returned in the createdDialog parameter is a reference to the dialog box that is created. You should only pass this value to the QTIsStandardParameterDialogEvent and QTDismissStandardParameterDialog functions.
You can modify the default behavior of the dialog box that is created by calling QTStandardParameterDialogDoAction (see "QTStandardParameterDialogDoAction" .
The QTIsStandardParameterDialogEvent function determines if an event returned from WaitNextEvent is processed by a standard parameter dialog box created by QTCreateStandardParameterDialog .
OSErr QTIsStandardParameterDialogEvent (
EventRecord *pEvent,
QTParameterDialog createdDialog);
This function determines whether an operating system event, as returned by a call to the WaitNextEvent function, is processed by the standard parameters dialog box created by QTCreateStandardParameterDialog . If the event is processed by the dialog box it is handled by this function, otherwise it is an event that your application is responsible for processing.
After you create a standard parameter dialog box, you must pass every event received from WaitNextEvent through the QTIsStandardParameterDialogEvent function to determine if your application should handle the event. Once the dialog box has been confirmed or cancelled by the user, you should no longer call the QTIsStandardParameterDialogEvent function.
You determine the status of the event by examining the return code of the QTIsStandardParameterDialogEvent function. This can be one of the following values:
The QTDismissStandardParameterDialog function closes a standard parameter dialog box that was created using the QTCreateStandardParameterDialog function. All memory associated with the dialog box is disposed of.
OSErr QTDismissStandardParameterDialog (QTParameterDialog createdDialog);
The QTStandardParameterDialogDoAction function allows you to change some of the default behaviors of the standard parameter dialog box.
OSErr QTStandardParameterDialogDoAction(
QTParameterDialog createdDialog,
long action,
void *params);
The QTStandardParameterDialogDoAction function allows you to change some of the default behaviors of a standard parameter dialog box you create using the QTCreateStandardParameterDialog function. To choose which of the available customizations to perform, pass an action selector value in the action parameter and, optionally, a single parameter in params .
The following list details the valid action selectors:
The QTGetEffectSpeed function returns the speed of the effect, expressed in frames-per-second.
OSErr QTGetEffectSpeed (
QTAtomContainer parameters,
Fixed *pFPS);
This function returns the execution speed of an effect in frames-per-second. The value returned should not be treated as an absolute measurement of effect performance. In particular, most effects only return one value, regardless of parameter settings and hardware. This value is an estimate of execution speed on a reference hardware platform. Actual performance will vary depending on hardware, configuration and parameter options.
Effects can also return the pre-defined constant effectIsRealtime as their speed. This means that the effect will execute as quickly as frames can be sent to it for rendering.
| Previous | Chapter Contents | Chapter Top | Next |